package com.shop.cloud.controller.system;

import io.swagger.annotations.ApiOperation;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.shop.cloud.common.mybatis.BaseController;
import com.shop.cloud.domain.hongfu.Log;
import com.shop.cloud.domain.hongfu.SysEdition;
import com.shop.cloud.filter.CurrentUserId;
import com.shop.cloud.model.response.ObjectDataResponse;
import com.shop.cloud.service.hongfu.ILogService;
import com.shop.cloud.service.hongfu.ISysEditionService;
import com.shop.cloud.util.Page;

@RestController
@RequestMapping(value = "log" )
public class SysLogController extends BaseController {

	private static final Logger logger=Logger.getLogger(SysLogController.class);
	
	@Autowired
	private ILogService logService;
	
	
	
	//查询日志
	//@MagicPermission
	@ApiOperation(value = "查询日志" , notes="查询日志")
	@RequestMapping(value = "queryLog", method = {RequestMethod.POST}  )
	@ResponseBody
	public ObjectDataResponse<Page<Log>> queryLog(@CurrentUserId Long userId,@RequestBody Log log){
//		logService.addLog(userId, 0, "查询日志");
		log.setOrderBy("create_time desc");
		Page<Log> datas=logService.pageLog(log);
		return new ObjectDataResponse<Page<Log>>(datas);
	}

	
	
}